cmake_minimum_required(VERSION 2.5)
project(mymuduo)

# mymuduo 最终编译成 so 动态库，设置动态库路径，放在根目录的 lib 文件夹下面
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
# 设置调试信息
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++11 -fPIC")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)

set(SOURCE_FILES
    src/Acceptor.cc
    src/Buffer.cc
    src/Channel.cc
    src/CurrentThread.cc
    src/DefaultPoller.cc
    src/EventLoop.cc
    src/EPollPoller.cc
    src/EventLoopThread.cc
    src/EventLoopThreadPool.cc
    src/InetAddress.cc
    src/Poller.cc
    src/Socket.cc
    src/TcpConnection.cc
    src/TcpServer.cc
    src/Thread.cc
    src/Timestamp.cc
    src/ConsistentHashEventThreadPool.cc
    src/TaskQueue.cc
    src/LoadBalancedEventThreadPool.cc
    src/Logger.cc
)


#编译动态库mymuduo
add_library(mymuduo SHARED ${SOURCE_FILES})
# add_executable(mymuduo ${SOURCE_FILES})

# target_link_libraries(mymuduo pthread)